package com.ultrapower.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ultrapower.commons.result.PageInfo;
import com.ultrapower.mapper.BlackListMapper;
import com.ultrapower.model.LlBlackListDm;
import com.ultrapower.service.IBlackListService;

/**
*
* 黑名单数据服务层接口实现类
*
*/
@Service
public class BlackListServiceImpl extends ServiceImpl<BlackListMapper, LlBlackListDm> implements IBlackListService{

	@Autowired
    private BlackListMapper blackListMapper;
	@Override
	public void selectDataGrid(PageInfo pageInfo) {
		// TODO Auto-generated method stub
		Page<Map<String, Object>> page = new Page<Map<String, Object>>(pageInfo.getNowpage(), pageInfo.getSize());
        page.setOrderByField(pageInfo.getSort());
        page.setAsc(pageInfo.getOrder().equalsIgnoreCase("asc"));
        List<Map<String, Object>> list = blackListMapper.selectBlackListPage(page, pageInfo.getCondition());
        pageInfo.setData(list);
        pageInfo.setCount(page.getTotal());
	}
	@Override
	public List<LlBlackListDm> selectBlackList() {
		// TODO Auto-generated method stub
		return blackListMapper.selectBlackList();
	}
	@Override
	public int selectListCount() {
		return blackListMapper.selectListCount();
	}
	@Override
	public List<String> getSendMsgData() {
		List<String> list = blackListMapper.selectSendMsgData();
		return list;
	}
	@Override
	public void updateState(String phone) {
		blackListMapper.updateState(phone);
	}
	@Override
	public void updateReplyMsg(Map<String, Object> condition) {
		blackListMapper.updateReplyMsg(condition);
	}

}
